#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFileDialog>
#include <QLabel>
#include <QStringList>
#include <QDebug>
#include <QMessageBox>
#include <QComboBox>
#include <QTreeView>
#include <QStandardItemModel>
#include <QTreeWidgetItemIterator>
#include <QListWidget>
#include <QList>
#include <rosbag/bag.h>
#include <rosbag/view.h>
#include <ctime>
#include <string>
#include <boost/foreach.hpp>
#include <geometry_msgs/TransformStamped.h>
#include <tf2_msgs/TFMessage.h>
#include <map>


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_choose_bag_btn_clicked();

    void on_actionOpen_triggered();



    void on_actionClose_triggered();

    void on_next_btn_clicked();

    void deal_image_data(QStringList*);
    void deal_pointCloud_data(QStringList*);
    void deal_pose_data(QStringList*);

    void on_back_btn_clicked();

    void on_actionnext_triggered();

    void on_actionBack_triggered();

    void on_select_tardir_btn_clicked();

signals:
    void readyDealPose(QStringList*);
    void readyDealImage(QStringList*);
    void readyDealPointCloud(QStringList*);

private:
    Ui::MainWindow *ui;
    QString bagfileName;
    QString targetDir;
    rosbag::Bag bag;
    QStringList imageTopics;
    QStringList pointCloudTopics;
    QStringList poseTopics;
    QStringList dummyTopics;
    QList<QStringList*> checkedTopics;
    QListWidget *tfWidget;
    bool step1;
    std::vector<std::pair<QString, QString> > tfVec;


private:
    void setTopicsSelector();
    bool treeWidgetHasChecked();
    QList<QStringList*> getCheckedTopics();

};

#endif // MAINWINDOW_H
